<template>
  <div>
    <el-divider />
    <h4>QMG评分量表</h4>
    <el-form ref="form" :model="form" label-width="180px">
      <el-form-item label="得分">
        <el-input v-model="score" style="width:200px" disabled />
      </el-form-item>
      <el-form-item label="左右视出现复视:">
        <el-radio-group v-model="form.diplopia">
          <el-radio :label="0">大于60</el-radio>
          <el-radio :label="1">11-60</el-radio>
          <el-radio :label="2">1-10</el-radio>
          <el-radio :label="3">小于1</el-radio>
        </el-radio-group>
        <!-- <timer /> -->
      </el-form-item>
      <el-form-item label="上视出现眼睑下垂:">
        <el-radio-group v-model="form.blepharoptosis">
          <el-radio :label="0">大于60</el-radio>
          <el-radio :label="1">11-60</el-radio>
          <el-radio :label="2">1-10</el-radio>
          <el-radio :label="3">小于1</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="眼睑闭合:">
        <el-radio-group v-model="form.eyelidClosure">
          <el-radio :label="0">正常</el-radio>
          <el-radio :label="1">闭合且能抵抗部分阻力</el-radio>
          <el-radio :label="2">闭合但不能抵抗阻力</el-radio>
          <el-radio :label="3">不能闭合</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="吞咽100ml水:">
        <el-radio-group v-model="form.swallow">
          <el-radio :label="0">正常</el-radio>
          <el-radio :label="1">轻度呛咳</el-radio>
          <el-radio :label="2">严重呛咳或鼻腔返流</el-radio>
          <el-radio :label="3">不能完成</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="数数1-50:">
        <el-radio-group v-model="form.count">
          <el-radio :label="0">未出现构音障碍</el-radio>
          <el-radio :label="1">30-49</el-radio>
          <el-radio :label="2">10-29</el-radio>
          <el-radio :label="3">小于10</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="坐位右上肢抬起90度">
        <el-radio-group v-model="form.sitUp1">
          <el-radio :label="0">大于等于240</el-radio>
          <el-radio :label="1">90-239</el-radio>
          <el-radio :label="2">10-89</el-radio>
          <el-radio :label="3">小于10</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="坐位左上肢抬起90度:">
        <el-radio-group v-model="form.sitUp2">
          <el-radio :label="0">大于等于240</el-radio>
          <el-radio :label="1">90-239</el-radio>
          <el-radio :label="2">10-89</el-radio>
          <el-radio :label="3">小于10</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="肺活量（%预计值）:">
        <el-radio-group v-model="form.vitalCapacity">
          <el-radio :label="0">大于等于80</el-radio>
          <el-radio :label="1">65-79</el-radio>
          <el-radio :label="2">50-64</el-radio>
          <el-radio :label="3">小于50</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="握力性别:">
        <el-radio-group v-model="form.sex" @change="handleSex">
          <el-radio :label="1">男</el-radio>
          <el-radio :label="2">女</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item :label="sexRightValue">
        <el-radio-group v-model="form.rightHandGrip">
          <el-radio :label="0">{{ sexRightRadio1 }}</el-radio>
          <el-radio :label="1">{{ sexRightRadio2 }}</el-radio>
          <el-radio :label="2">{{ sexRightRadio3 }}</el-radio>
          <el-radio :label="3">{{ sexRightRadio4 }}</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item :label="sexLeftValue">
        <el-radio-group v-model="form.leftHandGrip">
          <el-radio :label="0">{{ sexLeftRadio1 }}</el-radio>
          <el-radio :label="1">{{ sexLeftRadio2 }}</el-radio>
          <el-radio :label="2">{{ sexLeftRadio3 }}</el-radio>
          <el-radio :label="3">{{ sexLeftRadio4 }}</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="平卧位抬头（秒）:">
        <el-radio-group v-model="form.pwwtt">
          <el-radio :label="0">大于等于120</el-radio>
          <el-radio :label="1">30-119</el-radio>
          <el-radio :label="2">1-29</el-radio>
          <el-radio :label="3">小于1</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="平卧位右下肢抬起（秒）:">
        <el-radio-group v-model="form.pwwtq1">
          <el-radio :label="0">大于等于100</el-radio>
          <el-radio :label="1">31-99</el-radio>
          <el-radio :label="2">1-30</el-radio>
          <el-radio :label="3">小于1</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="平卧位左下肢抬起（秒）:">
        <el-radio-group v-model="form.pwwtq2">
          <el-radio :label="0">大于等于100</el-radio>
          <el-radio :label="1">31-99</el-radio>
          <el-radio :label="2">1-30</el-radio>
          <el-radio :label="3">小于1</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
// import Timer from './timer'

export default {
  // components: {
  //   Timer
  // },
  data() {
    return {
      form: {
        diplopia: 0,
        blepharoptosis: 0,
        eyelidClosure: 0,
        swallow: 0,
        count: 0,
        sitUp1: 0,
        sitUp2: 0,
        vitalCapacity: 0,
        sex: 0,
        rightHandGrip: 0,
        leftHandGrip: 0,
        pwwtt: 0,
        pwwtq1: 0,
        pwwtq2: 0,
        pId: this.pId,
        id: ''
      },
      sexRightValue: '右手握力kgW(男性)',
      sexLeftValue: '左手握力kgW(男性)',
      sexRightRadio1: '大于等于45',
      sexRightRadio2: '15-44',
      sexRightRadio3: '5-14',
      sexRightRadio4: '小于5',
      sexLeftRadio1: '大于等于35',
      sexLeftRadio2: '15-34',
      sexLeftRadio3: '5-14',
      sexLeftRadio4: '小于5'
    }
  },
  inject: [
    'pId'
  ],
  computed: {
    score() {
      var sum = Object.values(this.form).reduce((x, y) => x + y)
      return sum
    }
  },
  methods: {
    handleSex(v) {
      this.sexRightValue = v === 1 ? '右手握力kgW(男性)' : '右手握力kgW(女性)'
      this.sexLeftValue = v === 1 ? '右手握力kgW(男性)' : '右手握力kgW(女性)'
      this.sexRightRadio1 = v === 1 ? '大于等于45' : '大于等于30'
      this.sexRightRadio2 = v === 1 ? '15-44' : '10-29'
      this.sexRightRadio3 = v === 1 ? '5-14' : '5-9'
      this.sexRightRadio4 = v === 1 ? '小于5' : '0-4'
      this.sexLeftRadio1 = v === 1 ? '大于等于35' : '大于等于25'
      this.sexLeftRadio2 = v === 1 ? '15-34' : '10-24'
      this.sexLeftRadio3 = v === 1 ? '5-14' : '5-9'
      this.sexLeftRadio4 = v === 1 ? '小于5' : '0-4'
    }
  }
}
</script>

<style>

</style>
